<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
?>
<div id="ownservices">
 	<div id="mainmenuownservice">
 		<?php echo MenuHelper::nav(); ?>
 	</div>
	<div id="mainownservice">
		<h3> <?php echo $this->params->get('page_title'); ?> </h3>
		<hr />
		<?php
			$row = $this->row;
		?>
		<form action="index.php" method="post" id="adminForm" name="adminForm" autocomplete="off">
		<table width="100%" cellpadding="1" cellspacing="1">
		<tr>
			<td>
				<!-- sender -->
				<table class="admintable">
					<tr>
						 <td class="key"><?php echo JText::_('OWNSERVICE_SENDER'); ?></td>
						 <td><?php echo $row->username.' '.$this->row->name; ?></td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_ACCOUNTS'); ?> <span class="red">*</span></td>
						<td>
							<div id="accountno"><?php echo $this->lists['account']; ?></div>
						</td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_AMOUNT_TRANSFER'); ?> <span class="red">*</span></td>
						<td>
							<input type="text" name="amount" id="amount" value="<?php echo $row->amount ?>" class="inputbox required" size="10" /> AUD 
							<input type="button" name="acalculation" id="acalculate" value="<?php echo JText::_('OWNSERVICE_CALCULATE'); ?>" onClick="getTotalExchange();" />
						</td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_FEE'); ?></td>
						<td>
							<input type="text" name="fee" id="fee" value="<?php echo $row->fee ?>" readonly="true" class="inputbox" size="10" /> +- <input type="text" name="extrafee" value="<?php echo $row->extrafee; ?>" class="inputbox" size="5" maxlength="5" /> AUD
						</td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_EXCHANGE_RATE'); ?> <span class="red">*</span></td>
						<td>
							<input type="text" id="rate" name="rate" value="<?php echo $row->rate; ?>" class="inputbox required" size="10" readonly="true" /> +- <input type="text" name="extrarate" value="<?php echo $row->extrarate; ?>" class="inputbox" size="5" maxlength="5" /> 
							<span class="code"><?php echo $row->rate_code; ?></span>
						</td>
					</tr>
					<tr>
						<td class="key"> <?php echo JText::_('OWNSERVICE_DESTINATION_FEE'); ?></td>
						<td>
							<input type="text" name="bankfee" id="bankfee" value="<?php echo $row->bankfee ?>" class="inputbox" size="10" readonly="true" /> +- <input type="text" name="extrabfee" value="<?php echo $row->extrabfee; ?>" class="inputbox" size="5" maxlength="5" /> 
							<span class="code"><?php echo $row->rate_code; ?></span>
						</td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_TOTAL_EXCHANGE'); ?></td>
						<td>
							<input type="text" name="sumtotal" id="total" value="<?php echo $row->total; ?>" class="inputbox" size="10" /> 
							<span class="code"><?php echo $row->rate_code; ?></span> 
							<input type="button" name="acalculation" id="acalculate" value="<?php echo JText::_('OWNSERVICE_CALCULATE'); ?>" onClick="getTotalTransfer();" />
						</td>
					</tr>
					<tr>
						<td><?php echo JText::_('OWNSERVICE_EXTRA'); ?></td>
						<td>
							<input type="text" name="extratotal" value="<?php echo $row->extratotal; ?>" class="inputbox" size="10" /> <span class="code"><?php echo $row->rate_code; ?></span>
						</td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_REASON'); ?> </td>
						<td><?php echo $this->lists['reason']; ?></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<div id="reasonother" <?php if($row->reason_other == ''): ?>style="display:none;"<?php endif; ?>>
								<input type="text" name="reason_other" value="<?php echo $row->reason_other; ?>" class="inputbox" style="width: 250px;" />
							</div>
						</td>
					</tr>
					<tr>
						<td class="key"><?php echo JText::_('OWNSERVICE_COMMENTS'); ?></td>
						<td><textarea name="comment" id="comment" cols="30" rows="3" class="inputbox" style="width: 250px;"><?php echo $row->comment; ?></textarea></td>
					</tr>
					<tr>
						<td colspan="2" id="otherdetail">
						<?php  if($row->amount > 10000): ?>
							<table width="100%" cellspacing="1" cellpadding="1">
								<tbody>
									<tr>
										<td class="key"><?php echo JText::_('OWNSERVICE_OCCUPATION'); ?></td>
										<td><input type="text" value="<?php echo $row->occupation; ?>" id="occupation" name="occupation"></td>
									</tr>
									<tr>
										<td class="key"><?php echo JText::_('OWNSERVICE_BIRTHDAY_RECEIVER'); ?></td>
										<td><?php echo JHTML::_('calendar', $row->birthday, 'birthday', 'birthday', '%Y-%m-%d',array('class'=>'inputbox')); ?></td>
									</tr>
								</tbody>
							</table>
						<?php endif; ?>
						</td>
					</tr>
					</table>
				</td>
				<td valign="top">
					<div id="mphoto">
						<?php if($this->image->filename): ?>
						<a class="img-preview" href="<?php echo JURI::root(true).'/'.OwnserviceHelper::getParams('path', 'images/stories/ownservices').'/'.$row->user_id.'/'.$this->image->filename ?>">
							<img src="<?php echo JURI::root(true).'/'.OwnserviceHelper::getParams('path', 'images/stories/ownservices').'/'.$row->user_id.'/'.$this->image->filename; ?>" style="border: 0; width:<?php echo $this->image->width; ?>px; height:<?php echo $this->image->height; ?>px;" />
						</a>
						<?php endif; ?>
					</div>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input type="button" name="save" id="save" value="<?php echo JText::_('OWNSERVICE_SAVE'); ?>" onClick="javascript: submitbutton('customertransfersave');" />	
					<input type="button" name="cancel" id="cancel" value="<?php echo JText::_('OWNSERVICE_CLOSE'); ?>" onClick="javascript: submitbutton('customertransfercancel');" />
				</td>
			</tr>
			</table>
			
			<input type="hidden" name="branch_id" value="<?php echo $row->branch_id; ?>" />
			<input type="hidden" name="rate_id" value="<?php echo $row->rate_id; ?>" />
			<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
			<input type="hidden" name="user_id" id="user_id" value="<?php echo $row->user_id; ?>" />
			<input type="hidden" name="option" value="com_ownservice" />
			<input type="hidden" name="task" value="save" />
			<input type="hidden" name="calculate" value="0" />
			<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
			<input type="hidden" name="controller" value="transaction" />
			<input type="hidden" name="view" value="transaction" />
			<?php echo JHTML::_( 'form.token' ); ?>
		</form>
	</div>
</div>
<!-- max sender transfer -->
<div id="maxsendertransfer"></div>